//
//  UILabel+Translate.m
//  HeartBeat
//
//  Created by karong on 2023/9/8.
//

#import "UILabel+Translate.h"
#import <objc/runtime.h>
@implementation UILabel (Translate)
//+ (void)load{
//    static dispatch_once_t onceToken;
//    dispatch_once(&onceToken, ^{
//        Class class =  [self class];
//        SEL setTitleSel = @selector(setText:);
//        SEL setLanguageSel = @selector(setLanguageTitle:);
//        Method setTitleMethod = class_getInstanceMethod(class, setTitleSel);
//        Method setLanguageTitleMethod = class_getInstanceMethod(class, setLanguageSel);
//        BOOL suc = class_addMethod(class, setTitleSel, method_getImplementation(setLanguageTitleMethod), method_getTypeEncoding(setLanguageTitleMethod));
//        if (suc) {
//            class_replaceMethod(class, setLanguageSel, method_getImplementation(setTitleMethod), method_getTypeEncoding(setTitleMethod));
//        }else{
//            method_exchangeImplementations(setTitleMethod, setLanguageTitleMethod);
//        }
//    });
//}
//
//- (void)setLanguageTitle:(NSString *)str{
//    NSLog(@"%@", NSLocalizedString(str, nil));
//    [self setLanguageTitle:NSLocalizedString(str, nil)];
//}
@end
